<div class="modal-header">
	<button type="button" class="close" data-dismiss="modal" aria-label="Close">
		<span aria-hidden="true">&times;</span>
	</button>
	<h5 class="modal-title" id="addModalLabel">添加</h5>
</div>
<form id="addForm" role="form" class="form-horizontal parsley-form" data-parsley-validate action="${base}/platform/train/lumpproduct/addDo" method="post">
	<div class="modal-body">                
		<div class="row mb10">
        	<div class="col-lg-12">
               	<div class="form-group">
               		<label for="region_id" class="col-sm-2 control-label">选择片区</label>
                   	<div class="col-sm-4">
                      	<select id="region_id" name="region_id" class="form-control" required="required">
                          	<%for(region in obj.regions){%>
                           		<option value="${region.id}">${region.name}</option>
                           	<%}%>
                       	</select>
                    </div>
                   	<label for="project_id" class="col-sm-2 control-label">选择项目</label>
                    <div class="col-sm-4">
                     	<select id="project_id" name="project_id" class="form-control" required="required">
                           	<%for(project in obj.projects){%>
                               	<option value="${project.id}">${project.name}</option>
                             <%}%>
                        </select>
                    </div>
               	</div>
            	<div class="form-group">
                	<label for="name" class="col-sm-2 control-label">名称</label>
					<div class="col-sm-4">
                   		<input type="text" id="name" class="form-control" name="name" required="required" placeholder="名称">
                  	</div>
                  	
                  	<label for="code" class="col-sm-2 control-label">编号</label>
					<div class="col-sm-4">
                    	<input type="text" id="code" class="form-control" name="code" required="required" placeholder="编号">
                    </div>
                </div>
                <div class="form-group">
                	<label for="fullname" class="col-sm-2 control-label">全名</label>
					<div class="col-sm-6">
                  		<input type="text" id="fullname" class="form-control" name="fullname" required="required" placeholder="全名">
                  	</div>
                </div>
                <div class="form-group">
                	<label for="train_mode" class="col-sm-2 control-label">培训方式</label>
                  	<div class="col-sm-3">
                   		<lable><input type="radio" name="train_mode" required="required" value="1"  />学时包干</lable>
                      	<lable><input type="radio" name="train_mode" required="required" value="0"  />计时</lable>
                 	</div>
                 	
                 	<label for="shuttle_mode" class="col-sm-2 control-label">接送方式</label>
					<div class="col-sm-5">
                      	<input type="radio" name="shuttle_mode" required="required" value="0"  />无接送
                        <input type="radio" name="shuttle_mode" required="required" value="1"  />班车接送
                        <input type="radio" name="shuttle_mode" required="required" value="2"  />定点接送
                    </div>
                </div>
                        <div class="form-group">
                            <label for="price" class="col-sm-2 control-label">价格</label>
                            
                            <div class="col-sm-8">
                                <input type="text" id="price" class="form-control" name="price" required="required"  placeholder="价格" >
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="specs" class="col-sm-2 control-label">产品规格</label>
                            
                            <div class="col-sm-8">
                                <input type="text" id="specs" class="form-control" name="specs" required="required"  placeholder="产品规格">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="payment" class="col-sm-2 control-label">付款说明</label>
                            
                            <div class="col-sm-8">
                                <input type="text" id="payment" class="form-control" name="payment" required="required"  placeholder="付款说明">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="remark" class="col-sm-2 control-label">服务说明</label>
                            
                            <div class="col-sm-8">
                                <input type="text" id="remark" class="form-control" name="remark" required="required"  placeholder="服务说明">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="state" class="col-sm-2 control-label">状态</label>

                            <div class="col-sm-8">
                                 <input type="radio" name="state" required="required" value="1"  />启用
                                 <input type="radio" name="state" required="required" value="0"  />禁用
                                 <input type="radio" name="state" required="required" value="-1"  />已作废
                            </div>
                        </div>
                    </div>
                </div>
    </div>
	<div class="modal-footer">
		<button  class="btn btn-default btn-sm btn-parsley" >完成</button> 
	</div>
</form>
<script language="JavaScript">
   $(document).ready(function () {
    	var dialog=$("#addModal");
		$("#addModalDialog").draggable();
        $('#addForm').ajaxForm({
            dataType: 'json',
            beforeSubmit: function (arr, form, options) {
            },
            success: function (data, statusText, xhr, form) {
                if (data.code==0) {
                    Toast.success(data.msg);
                    datatable.ajax.reload();
                    dialog.modal("hide");
                } else {
                	Toast.error(data.msg);
                    datatable.ajax.reload();
                    dialog.modal("hide");
                }
            }
        });
    }); 
</script>
